/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ohos.labels


public interface PermissionValue {
    operator func &(rhs: PermissionValue): PermissionValue
    
    operator func |(rhs: PermissionValue): PermissionValue
}

public class PermissionAnd <: PermissionValue {
    public let lhs: PermissionValue
    
    public let rhs: PermissionValue
    
    public const init(lhs: PermissionValue, rhs: PermissionValue)
    
    public operator const override func &(rhs: PermissionValue): PermissionValue
    
    public operator const override func |(rhs: PermissionValue): PermissionValue
}

public class PermissionOr <: PermissionValue {
    public let lhs: PermissionValue
    
    public let rhs: PermissionValue
    
    public const init(lhs: PermissionValue, rhs: PermissionValue)
    
    public operator const override func &(rhs: PermissionValue): PermissionValue
    
    public operator const override func |(rhs: PermissionValue): PermissionValue
}

extend String <: PermissionValue {
    public operator const func &(rhs: PermissionValue): PermissionValue
    
    public operator const func |(rhs: PermissionValue): PermissionValue
}

public interface LevelValue {
}

extend Int64 <: LevelValue {
}

extend String <: LevelValue {
}

@Annotation
public class APILevel {
    // since
    public let since: LevelValue
    
    public let atomicservice: Bool
    
    public let crossplatform: Bool
    
    // deprecated: 0 means the Api is not deprecated
    public let deprecated: LevelValue
    
    public let form: Bool
    
    public let permission: ?PermissionValue
    
    public let stagemodelonly: Bool
    
    public let syscap: String
    
    public let throwexception: Bool
    
    public let workerthread: Bool
    
    public let systemapi: Bool
    
    public const init(since: LevelValue, atomicservice!: Bool = false, crossplatform!: Bool = false,
        deprecated!: LevelValue = 0, form!: Bool = false, permission!: ?PermissionValue = None, stagemodelonly!: Bool = true,
        syscap!: String = "", throwexception!: Bool = false, workerthread!: Bool = false, systemapi!: Bool = false)
}

